public class Teacher5 extends Person5 {

    private int work_age;

    public Teacher5(String name, genderEnum gender, int age, int work_age) {
        super(name,gender,age);
        this.work_age = work_age;
    }



    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }
    public void teach(){
        System.out.println("我会好好教学Java");
    }
    @Override
    public String play(){
        return super.play()+"爱玩象棋";
    }
    public void printInfo(){
        System.out.println("老师的信息:");
        System.out.println(super.basicInfo());
        System.out.println("工作年限:"+work_age);
        teach();
    }

    @Override
    public String toString() {
        return super.toString()+"Teacher5{" +
                "work_age=" + work_age +
                '}';
    }
}
